package org.aileen.captcha.controller;

import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/log")
@RestController
public class LogController {
    //private static Logger logger = LoggerFactory.getLogger(LogController.class);//通过Lombok自动添加,他会生成一个名为log的对象

    @PostConstruct
    public void print() {
        System.out.println("打印日志");
        System.out.println("==============");
        log.trace("我的trace日志");
        log.debug("我的debug日志");
        log.info("我的info日志");
        log.warn("我的warn日志");
        log.error("我的error日志");

    }
}
